home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tegl6b.zip / INTROPAK.EXE / lha / PREPARE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-06  |  1KB  |  44 lines

  1. {-- This program shows how prepareforupdate and commitupdate work }
  2. {-- together in uncovering and then recovering an image so that drawing }
  3. {-- can be performed on a frame that is partially (or completely) }
  4. {-- covered. }
  5.  
  6. Uses  tgraph,TEGLIntr,TEGLUnit,TEGLMain;
  7.  
  8. VAR FS : ImageStkPtr;
  9.  
  10. BEGIN
  11.  
  12.   EasyTEGL;
  13.   EasyOut;
  14.  
  15.   {-- create the bottom frame (which we are going to draw on }
  16.  
  17.   PushImage(1,1,100,100);
  18.   ShadowBox(1,1,100,100);
  19.   fs := StackPtr;            {-- save the imagestkptr }
  20.  
  21.   {-- create the frame that partially covers it. }
  22.  
  23.   PushImage(50,50,150,150);
  24.   ShadowBox(50,50,150,150);
  25.  
  26.   {-- as soon as there is a mouse press then we go to work }
  27.  
  28.   WHILE Mouse_Buttons = 0 DO;
  29.   {-- tells the window manager to uncover the frame because we want to}
  30.   {-- work on it (draw to it). }
  31.  
  32.   PrepareForUpdate(fs);
  33.   SetColor(blue);
  34.   Circle(fs^.x+48,fs^.y+45,40);
  35.  
  36.   {-- commitupdate then tells the window manager that all drawing is done }
  37.   {-- and it can return things to how they were before prepareforupdate. }
  38.  
  39.   CommitUpdate;
  40.  
  41.  
  42.   TEGLSupervisor;
  43. END.
  44.